<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <base href="#(basePath)"/>
  <title>单笔付款到银行卡</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="static/layui/css/layui.css" media="all">
</head>
<body>
  <div class="layui-fluid">
    <div class="layui-card" style="margin-top:14px;">
	  <div class="layui-form layui-form-pane">
		<div class="layui-form-item" pane>
		  <label class="layui-form-label">收款户名</label>
			<div class="layui-input-block">
				<input type="text" name="title" lay-verify="title" autocomplete="off" placeholder="请输入收款方户名" class="layui-input">
			</div>
		</div>
	  <div class="layui-form-item" pane>
		  <label class="layui-form-label">收款账号</label>
		  <div class="layui-input-block">
			  <input type="text" name="title" lay-verify="title" autocomplete="off" placeholder="请输入收款方账号" class="layui-input">
		  </div>
	  </div>
		  <div class="layui-form-item" pane>
			  <label class="layui-form-label">开户行</label>
			  <div class="layui-input-block">
				  <input type="text" name="title" lay-verify="title" autocomplete="off" placeholder="请输入收款方开户行名称" class="layui-input">
			  </div>
		  </div>
		  <div class="layui-form-item" pane>
			  <label class="layui-form-label">开户行行号</label>
			  <div class="layui-input-block">
				  <input type="text" name="title" lay-verify="title" autocomplete="off" placeholder="请输入收款方开户行行号" class="layui-input">
			  </div>
		  </div>
		<div class="layui-form-item">
			<label class="layui-form-label">制单密码</label>
			<div class="layui-input-block">
				<input type="password" name="payPassword" id="payPassword" required lay-verify="required" placeholder="制单密码" size="30" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
		<button type="button" class="layui-btn" id="submitBtn">立即提交</button>
		</div>
      </div>
	</div>
  </div>
  <script src="static/layui/layui.js"></script>
  <script>
  layui.config({
	base: '#(basePath)' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'upload'], function(){
    var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引  
	var upload = layui.upload;
	//执行实例
	var uploadInst = upload.render({
		elem: '#payfile' 												// 绑定元素
		,url: '#(basePath)merch/payorder/batchPay'	// 上传接口
		//,field:''															// 设定文件域的字段名
		,data: {payPassword: function(){ return layui.$('#payPassword').val(); }}	// 请求上传接口的额外参数
		,accept: "file"												// 指定允许上传时校验的文件类型，可选值有：images（图片）、file（所有文件）、video（视频）、audio（音频）
		,auto: false	// 是否选完文件后自动上传。如果设定 false，那么需要设置 bindAction 参数来指向一个其它按钮提交上传
		,bindAction:'#submitBtn'// 指向一个按钮触发上传，一般配合 auto: false 来使用。值为选择器或DOM对象，如：bindAction: '#btn'
		,done: function(res){
		  //上传完毕回调
		  if(res.code == 0){
			  parent.layer.msg(res.msg, {icon:1});
    	      parent.layer.close(index); //执行关闭
    	      parent.location.reload();
		  }else{
			  parent.layer.msg(res.msg, {icon:2});
		  }
		}
		,error: function(){
		  //请求异常回调
			parent.layer.msg("出错了", {icon:2});
		}
	});
  })
  </script>
</body>
</html>
